AS=as
LD := ld -m elf_x86_64
LD_FLAGS := -Ttext 0x0 -s --oformat binary

linux.img: bootsect
	cat bootsect > linux.img

bootsect: bootsect.o
	# ld -m elf_x86_64 -Ttext 0x0 -s --oformat binary -o $@ $<
	$(LD) $(LD_FLAGS) -o $@ $<

bootsect.o: bootsect.S
	$(AS) -o $@ $<


clean:
	rm -rf bootsect.o
	rm -rf bootsect
	rm -rf linux.img
